package ceshi;

import java.lang.reflect.Constructor;

interface Plugin {
    void execute();
}

class PluginA implements Plugin {
    @Override
    public void execute() {
        System.out.println("Plugin A executed.");
    }
}

class PluginB implements Plugin {
    @Override
    public void execute() {
        System.out.println("Plugin B executed.");
    }
}

public class Main {
    public static void main(String[] args) {
        String pluginName = "PluginA";
        try {
            Class<?> pluginClass = Class.forName(pluginName);
            Constructor<?> constructor = pluginClass.getConstructor();
            Plugin plugin = (Plugin) constructor.newInstance();
            plugin.execute();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}